package com.anzhen.interview.xml.study;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Arrays;
import java.util.List;

/**
 * Created by anzhen on 2017-4-27.
 */
@XmlRootElement
public class Person_4 {
	@XmlElements({
			@XmlElement(name = "Sheep", type = Sheep.class),
			@XmlElement(name = "Cat", type = Cat.class),
			@XmlElement(name = "Pig", type = Pig.class)
	})
	@XmlElementWrapper(name="animals")
	public List<Animal> animals = Arrays.asList(new Sheep(), new Cat(), new Pig()); }
